package cn.kgc.tangcco.tcbd1011.books.service.impl;

import java.util.List;

import cn.kgc.tangcco.tcbd1011.books.dao.BooksDao;
import cn.kgc.tangcco.tcbd1011.books.entity.Books;
import cn.kgc.tangcco.tcbd1011.books.service.BooksService;
import cn.kgc.tangcco.tcbd1011.books.vo.BooksVo;
import cn.kgc.tangcco.tcbd1011.booktype.dao.BookTypeDao;
import cn.kgc.tangcco.tcbd1011.booktype.entity.BookType;
import cn.kgc.tangcco.tcbd1011.comm.properties.PropertiesFactory;
import cn.kgc.tangcco.tcbd1011.util.Util;

public class BooksServiceImpl implements BooksService {
	private BooksDao dao;
	private BookTypeDao tdao;
	public BooksServiceImpl() {
		tdao=(BookTypeDao) PropertiesFactory.getInstance(Util.BOOKTYPEDAO);
		dao=(BooksDao) PropertiesFactory.getInstance(Util.BOOKSDAO);
	}
	@Override
	public int addBooks(Books books) {
		return dao.addBooks(books);
	}
	@Override
	public int updateBooks(Books books) {
		return dao.updateBooks(books);
	}
	@Override
	public int deleteBooks(int pk) {
		return dao.deleteBooks(pk);
	}
	@Override
	public List<BooksVo> queryAllBooks(BooksVo booksvo) {
		return dao.queryAllBooks(booksvo);
	}
	@Override
	public BooksVo detailBooks(int pk) {
		return dao.detailBooks(pk);
	}
	@Override
	public int queryCountBooks() {
		return dao.queryCountBooks();
	}
	@Override
	public List<BookType> queryTypeToBooks() {
		return tdao.queryTypeToBooks();
	}
	
}
